package com.geotmt.billingcenter.common.exception;

import com.geotmt.billingcenter.common.result.ResponseResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description 全局异常处理
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/3/14 11:46
 * @Version     v1
 **/
@ControllerAdvice
public class GeoException {

    private static final Logger logger = LoggerFactory.getLogger(GeoException.class);

    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    public ResponseResult exceptionHandler(Exception e){
        logger.error("Exception:",e);
        return ResponseResult.error(null);
    }
}
